﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script language="javascript">
        var email;
        function checkEmail() {
            email = document.getElementById("txtemail");
            var filter = /\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
            if (!filter.test(email.value)) {
                return false;
            }
        }
        function check() {
            var email_incorect = checkEmail();
            if (email_incorect == false) {
                alert("Email nhập chưa không hợp lệ.");
                email.focus();
            }
            else {
                alert("Email hợp lệ̀ :" + email.value);
                email.focus();
            }
        }
</script>
</head>
<body>
<label for="textfield">email</label>
<input type="text" name="txtemail" id="txtemail" />
<label for="Submit"></label>
<input type="button" 
	name="btok" 
	value="Button" 
	id="Submit" 
	onclick="check()" />
</body>
</html>
